<template>
  <div>
    <addleave @addList="addList"></addleave>
    <leavelist :list="list" type="2"></leavelist>
  </div>
</template>

<script lang="ts" setup>
import { ref, onMounted } from 'vue';
import { getLeave } from '@/serveice/leavelist';
import addleave from '@/components/AddLeave.vue';
import leavelist from '@/components/LeaveList.vue';
let list: any = ref([]);
onMounted(async () => {
  let { data } = await getLeave();
  if (data.code == 200) {
    list.value = data.list;
  }
})
function addList(item: any) {
  list.value = [...list.value, item]
}
</script>
<style scoped>
.dialog-footer button:first-child {
  margin-right: 10px;
}
</style>
